import { View } from "../../../mvc/core/View";
import { LayerManager } from "../../manager/LayerManager";
import { ObjCreate } from "../common/ObjCreate";
import { ResFileConst } from "../../resource/ResFileConst";
import { SecTimerView } from "../common/SecTimerView";
import { GTextFormat } from "../../../common/GTextFormat";
import { FontUtil } from "../../../common/font/FontUtil";
import { FilterConst } from "../../../component/gconst/FilterConst";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { DataEvent } from "../../events/DataEvent";
import { EventName } from "../../mvc/EventName";
import { Cache } from "../../cache/Cache";
import { HighlightManager } from "../../manager/HighlightManager";
import { GLoadedButton } from "../../../../com/mui/controls/GLoadedButton";
type int = number;
//class MarryCelebrationIconView
    
    export  class MarryCelebrationIconView extends View
    {
        constructor()
        {
            super();
            this.layer = LayerManager.rightTopUILayer;
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            this._celebrationBtn = ObjCreate.createGLoadedButton(ResFileConst.Celebration, 0, 0, 50, 50, this);
            this._celebrationBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onCelebrationBtnClick);
            this._leftTime = new SecTimerView();
            this._leftTime.mouseEnabled = false;
            var loc1=new GTextFormat(FontUtil.songtiName, 12, 16580352);
            loc1.align = flash.text.TextFormatAlign.CENTER;
            this._leftTime.defaultTextFormat = loc1;
            this._leftTime.filters = [FilterConst.glowFilter];
            ObjCreate.setObjAttri(this._leftTime, -5, 55, 60, 20, this);
            this._leftTime.mouseEnabled = false;
            return;
        }

        /* internal  */onCelebrationBtnClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.MarryShowMarryMsgWindow, Cache.instance.marry.celebrationWedding));
            return;
        }

        public updateLeftTime(arg1: int): void
        {
            this._leftTime.setLeftTime(arg1);
            return;
        }

        public flicker(): void
        {
            HighlightManager.instance.glowEffectButton(this._celebrationBtn, true);
            return;
        }

        /* internal */ /* var */_celebrationBtn: GLoadedButton;

        /* internal */ /* var */_leftTime: SecTimerView;
    }
